<html>
<head><meta charset="utf-8"><title>no_std println provider · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html">no_std println provider</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220835865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220835865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220835865">(Dec 23 2020 at 23:21)</a>:</h4>
<p>Has there been any discussion of a sort of <code>#[global_allocator]</code>-like functionality for providing something that the lang can use to allow printlns and whatnot on no_std? i searched a bit on github and didn't find anything.</p>



<a name="220843694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220843694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220843694">(Dec 24 2020 at 02:13)</a>:</h4>
<p>sounds like an excellent idea! also relevant is allowing redirection for things like buffering output from test cases, since the standard library's testing framework is not always the best option.</p>



<a name="220843846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220843846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220843846">(Dec 24 2020 at 02:18)</a>:</h4>
<p>I would love to see that as well.</p>



<a name="220843850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220843850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220843850">(Dec 24 2020 at 02:18)</a>:</h4>
<p>I've seen some proposals for a globals mechanism based on traits.</p>



<a name="220843935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220843935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220843935">(Dec 24 2020 at 02:21)</a>:</h4>
<p>it seems like there will need to be a lot of scary work in the compiler, at least from my cursory glance, but maybe a good start would be defining a proper framework for things like global_allocator, so it isn't totally ad-lib. is this the kind of thing that would need an rfc?</p>



<a name="220845529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220845529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220845529">(Dec 24 2020 at 03:10)</a>:</h4>
<p>I'm guessing yes, that it would need an RFC since it's a pretty big change, but it probably makes sense to have more pre-RFC discussion first.</p>



<a name="220846268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220846268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220846268">(Dec 24 2020 at 03:34)</a>:</h4>
<p>like technical details? i was thinking a trait with <code>stdout</code> and <code>stderr</code> methods, mostly drop-in to how _print and _eprint work right now</p>



<a name="220846341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220846341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220846341">(Dec 24 2020 at 03:36)</a>:</h4>
<p>I think associated types that implement Write would work.</p>



<a name="220847480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/no_std%20println%20provider/near/220847480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/no_std.20println.20provider.html#220847480">(Dec 24 2020 at 04:14)</a>:</h4>
<p><a href="https://github.com/rust-lang/rfcs/pull/2725#issuecomment-701527929">https://github.com/rust-lang/rfcs/pull/2725#issuecomment-701527929</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>